package com.lh.ssm.mapper;

import com.lh.ssm.domain.Cart;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

public interface CartMapper {

    Cart findCart(@Param("pid") int pid, @Param("uid") int uid);

    //int updateCart(@Param("total") BigDecimal total, @Param("count") int count,@Param("uid") Integer uid, @Param("pid") int pid );

    int updateCart(Cart cart);

    int insertCart(@Param("uid") int uid, @Param("pid") int pid, @Param("total") BigDecimal total, @Param("count") int count);

    List<Cart> findAllCart(int uid);

    Cart getCartByCid(int cid);

    int updateCartByTotal(@Param("cid") int cid, @Param("cnum") int cnum, @Param("total") BigDecimal total);

    int deleteById(int cid);

    int deleteByUid(int uid);

    List<Cart> selectCartByUid(int uid);
}
